<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>回忆论坛</title>
    <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"/>-->
    <link href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"
          type="text/css">
    <!--下拉式多选框-->
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="css/bootstrap-select/bootstrap-select.min.css">

    <!--jquery-->
    <script type="text/javascript" src="js/jquery-3.5.1.min.js"></script>

    <!-- Latest compiled and minified JavaScript -->
    <script src="js/bootstrap-select/bootstrap-select.min.js"></script>
    <!-- (Optional) Latest compiled and minified JavaScript translation files -->
    <script src="js/bootstrap-select/defaults-zh_CN.min.js"></script>

    <!--bootstrap-->
    <script src="js/bootstrap.min.js"></script>
</head>
<style>
    body {
        background-image: url("../../static/img/nier-high-gaosi.png");
        background-attachment: fixed;
        background-repeat: no-repeat;
        background-size: cover;
    }
</style>
<body>
<div class="navbar navbar-default navbar-fixed-top" role="navigation" th:fragment="nav">
    <div class="container">
        <div class="container-fluid">
            <!-- brand -->
            <div class="navbar-header">
                <a class="btn navbar-brand" href="/">忆往</a>
            </div>
            <!-- 可选项 -->
            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav" id="mytab">
                    <li><a class="btn" href="/">首页</a></li>
                    <li><a class="btn" href="/followList.htm">关注</a></li>
                    <li><a class="btn" href="/collectionList.htm">收藏</a></li>
                    <li><a class="btn" href="/browserMyself.htm">我的</a></li>
                    <!-- <li><a class="btn" onclick="skip('列表组.html')">Link</a></li> -->
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">分区<span
                                class="caret"></span></a>
                        <ul class="dropdown-menu" role="menu">
                            <li th:each="label:${session.labels}">
                                <a th:href="'/browseList.htm?label='+${label.getId()}"
                                   th:text="${label.getLabel()}">标签</a></li>
                        </ul>
                    </li>
                </ul>

                <!-- style="margin-left: 20%;" -->
                <form class="navbar-form navbar-left" method="post" action="/searchContent.htm">
                    <div class="form-group">
                        <input type="text" id="searchContent" name="content" class="form-control" placeholder="搜索"/>
                        <select class="form-control selected" id="type" name="type">
                            <option id="author" name="author" value="1">作者</option>
                            <option id="title" name="title" value="2" selected="selected">标题</option>
                            <option id="detail" name="detail" value="3">简介</option>
                        </select>
                    </div>
                    <button type="submit" class="btn btn-default">搜索</button>
                </form>

                <!-- 登录注册 -->
                <ul class="nav navbar-nav navbar-right">
                    <!--<li th:if="${session.user != null}"><a href="/login.html" target="main-body"><span
                            class="glyphicon glyphicon-user"></span>&nbsp;我的</a></li>-->
                    <li th:if="${session.user == null}"><a class="btn" href="/login.html"><span
                            class="glyphicon glyphicon-log-in"></span>&nbsp;登录</a></li>
                    <li th:if="${session.user == null}"><a href="/register.html"><span
                            class="glyphicon glyphicon-plus"></span>&nbsp;注册</a></li>
                    <li th:if="${session.user != null}"><a href="/sendPost.html"><span
                            class="glyphicon glyphicon-upload"></span>&nbsp;发帖</a></li>
                    <li th:if="${session.user != null}"><a href="/logout.htm"><span
                            class="glyphicon glyphicon-log-out"></span>&nbsp;注销</a></li>
                </ul>
            </div>
        </div>
    </div>
</div>
<!--<div>
    <iframe frameborder="0" id="main-body" name="main-body" width="100%" src="/browseList.htm"
            style="margin-top: 20px;"></iframe>
</div>-->
<script>
    // $("#mytab a").click(function (e) {
    //     e.preventDefault();
    //     $(this).tab("show");
    // })

    //设置iframe自动适配窗口大小
    /*$(document).ready(function () {
        //高度设置
        var height = $(window).height() - 26;
        $('#main-body').height(height);
    });

    function changeFrameHeight() {
        var ifm = document.getElementById("main-body");
        $('#main-body').height($(window).height());
    }

    window.onresize = function () {
        changeFrameHeight();
    }*/

    /*function skip(jhref) {
        parent.document.getElementById("main-body").src = jhref;
    }*/

    /*function skipIframe(href) {
        window.location.href = href;
    }*/
    $(function () {
        $("#moduleId").selectpicker();
    });
    $('#moduleId').selectpicker('refresh');
    $('#moduleId').selectpicker('render');
</script>
</body>
</html>
